<template>
	<view class="bus-page">

		<!-- 搜索 -->
		<!-- <view class="bus-index-top">
			<view class="search-box" >
				<view class="location-box" @click="changeAddress">
					<view class="location-address" >{{city?city:'切换城市'}}</view>
					<view class="triangle-border-down" style="margin:8rpx 32rpx 0 8rpx; border-top-color:#000"></view> 
				</view>
				<view @click="goSearch" class="search-input-containt">
					<image class="search-input-icon-search" src="/static/images/bus/search_icon3x.png"></image>
					<text class="search-input-edit">搜索公交线路、站点</text>
				</view>
			</view>
		</view> -->
		  <view class="page_hd">
		        <view class="rtbus-searchbar-frame">
		            <view class="rtbus-searchbar-button">
		               <!-- <view @click="changeAddress" class="rtbus-searchbar-button-title">
		                    <view class="rtbus-searchbar-button-name">{{city?city:'切换城市'}}</view>
		                    <image class="rtbus-searchbar-button-arrow" src="/static/images/bus/station_close.png"></image>
		                </view> -->
						
		                <!-- <input  @click="goSearch"  class="rtbus-search-bar__input" disabled="true" placeholder="搜索公交线路、站点" placeholderClass="input-placeholder" type="text"></input> -->
						<navigator url="/pages/search/index" class="rtbus-search-bar__input" hover-class="none"><text
								class="iconfont icon-xiazai5" style="margin-right: 5px;"></text>
							搜索公交线路、站点</navigator>
		               
		            </view>
		        </view>
		    </view>
		<!-- 选项卡 附近公交-我的收藏 -->
		<view class="bus-content-box">
			
			<view class="" style="margin-top: 15px;margin-left: 8px;">
				<vtabs  v-model="swiperIndex" bgColor="none" lineHeight="6rpx"
				 activeColor="#000" color="#afafaf" :bold="false" activeFontSize="36rpx"
				  :scroll="true" :tabs="tabbar" @change="swichNav"> </vtabs>
			</view>
			<!-- #ifdef MP-WEIXIN  -->
			<view style="margin: 15px;">
				<localBar  :show="showLocalAuth"></localBar>
			</view>
			<!-- #endif -->
			<!-- 附近公交站 -->
			<view class="staion-box" v-if="swiperIndex == 0">
				
				<!-- 没有数据 -->
				<view class="card_container" style="margin-top: 40rpx;" v-if="nodata&&(stationList.length==0)">
					<view style="text-align:center">
						<view style="padding:60rpx 150rpx;font-size:32rpx;text-align:center;color: rgba(0,0,0,0.38);">
							<text>当前城市暂无实时公交数据，请点击左上角切换城市查看~~~ </text>
						</view>
					</view>
				</view>
				
				<block>
					<view v-if="stationList.length" class="blk" v-for="(stationItem,stationIndex) in stationList" :key="stationIndex">
						<view class="station-card" >
							<view class="station-card-head station-card-head-border-bottom"
								@click.stop="changeStationState(stationIndex)">
								<view class="left">
									<image src="/static/images/bus/station2x.png"></image>
									<text class="station-name text-ellipsis">{{stationItem.stationName}}</text>
									<text
										class="home-font-sub font-color-weak-28">{{parseInt(stationItem.distance)}}m</text>
								</view>
								<view class="right">
									<text class="home-font-sub">{{stationItem.isOpen ? '收起' : '展开'}}</text>
									<image
										:src="stationItem.isOpen ? '/static/images/bus/station_open.png' : '/static/images/bus/station_close.png'">
									</image>
								</view>
							</view>
						
							<view class="station-card-list" v-show="stationItem.isOpen">
				
								<block   v-for="(lineItem,lineIndex) in stationItem.nearbySegment" :key="lineIndex">
									<view class="station-card-list-item" v-if="stationIndex == 0 && lineIndex < 2"
										@click="goLineDetail(lineItem)">
										<view class="line-name">
											<view class="leftnew">
												<view class="qs-line-name">
													{{lineItem.lineName}}
												</view>
												<view class="line-direction">开往{{lineItem.startStopName}}</view>
												
											</view>
											<view class="rightnew">
												<view v-if="lineItem.status==0" class="display-flex display-flex-column display-flex-align-end">
													<view v-if="lineItem.oneBus" class="">
														<view v-if="lineItem.oneBus.text!='已到站'" class="display-flex font18 fontw">
															<view  :class="lineItem.oneBus.text=='即将到站'?'txorcolor':'bluecolor'">
																{{lineItem.oneBus.text}}
																<text style="margin: 0 3px;">·</text>
															</view>
															<view :class="lineItem.oneBus.text=='即将到站'?'txorcolor':'bluecolor'" class="display-flex display-flex-align-start">
																<view  class="tx-trave">{{lineItem.oneBus.travelTime.value}}</view>
																<view >{{lineItem.oneBus.travelTime.unit}}</view>
																<image  style="width: 8px;height: 8px;margin-left: 2px;" :src="lineItem.oneBus.text=='即将到站'?'../../static/images/bus/ico-wifi-or.gif':'../../static/images/bus/ico-wifi-blue.gif'"></image>
																
															</view>
														</view>
														<view v-if="lineItem.oneBus.text=='已到站'" class="txorcolor fontw font18">
															已到站
														</view>
											
													</view>
													<view v-if="lineItem.twoBus" class="next-one display-flex display-flex-align-center">
														<view class="marginright5">
															下辆
														</view>
														<view class="marginright5">
															{{lineItem.twoBus.text}}
														</view>
														<view  v-if="parseInt(lineItem.twoBus.travelTime.value)>0" class="">
															{{lineItem.twoBus.travelTime.value}}{{lineItem.twoBus.travelTime.unit}}
														</view>
													</view>
												</view>
												<view v-else class="bluecolor fontw font18">
													{{lineItem.notice?lineItem.notice:"正在查询"}}
												</view>
											
											</view>
										</view>
										
									</view>
									<view class="station-card-list-item" v-else-if="openType == false || stationIndex !== 0"
										@click="goLineDetail(lineItem)">
										<view class="line-name">
											<view class="leftnew">
												<view class="qs-line-name">
													{{lineItem.lineName}}
												</view>
												<view class="line-direction">开往{{lineItem.startStopName}}</view>
												
											</view>
											<view class="rightnew">
												<view v-if="lineItem.status==0" class="display-flex display-flex-column display-flex-align-end">
													<view v-if="lineItem.oneBus" class="">
														<view v-if="lineItem.oneBus.text!='已到站'" class="display-flex font18 fontw">
															<view  :class="lineItem.oneBus.text=='即将到站'?'txorcolor':'bluecolor'">
																{{lineItem.oneBus.text}}
																<text style="margin: 0 3px;">·</text>
															</view>
															<view :class="lineItem.oneBus.text=='即将到站'?'txorcolor':'bluecolor'" class="display-flex display-flex-align-start">
																<view  class="tx-trave">{{lineItem.oneBus.travelTime.value}}</view>
																<view >{{lineItem.oneBus.travelTime.unit}}</view>
																<image  style="width: 8px;height: 8px;margin-left: 2px;" :src="lineItem.oneBus.text=='即将到站'?'../../static/images/bus/ico-wifi-or.gif':'../../static/images/bus/ico-wifi-blue.gif'"></image>
																
															</view>
														</view>
														<view v-if="lineItem.oneBus.text=='已到站'" class="txorcolor fontw font18">
															已到站
														</view>
											
													</view>
													<view v-if="lineItem.twoBus" class="next-one display-flex display-flex-align-center">
														<view class="marginright5">
															下辆
														</view>
														<view class="marginright5">
															{{lineItem.twoBus.text}}
														</view>
														<view  v-if="parseInt(lineItem.twoBus.travelTime.value)>0" class="">
															{{lineItem.twoBus.travelTime.value}}{{lineItem.twoBus.travelTime.unit}}
														</view>
													</view>
												</view>
												<view v-else class="bluecolor fontw font18">
													{{lineItem.notice?lineItem.notice:"正在查询"}}
												</view>
											
											</view>
										</view>
										
									</view>
								</block>
								<!-- 查看全部 -->
								<view class="see-all" v-if="stationIndex == 0 && stationItem.nearbySegment.length > 2"
									@click="setOpenType">
									<text class="font-color-weak-28">{{openType?'查看全部':'收起'}}</text>
								</view>
							</view>
						
							<view class="station-card-tag-list" v-show="!stationItem.isOpen">
								<view style="display: inline-block;"
									v-for="(lineItem,lineIndex) in stationItem.nearbySegment" :key="lineIndex">
									<view class="tag-item" v-if="lineIndex < 10" @click="goLineDetail(lineItem)">
										{{lineItem.lineName}}
									</view>
									<image class="more-img" v-if="lineIndex == 10" src="/static/images/bus/more.png">
									</image>
								</view>
							</view>
						</view>
						<!-- <view class="ad-item" v-if="stationIndex==0&&stationList.length==1">
							<sx-banner></sx-banner>
						</view> -->
						<!-- #ifdef MP-WEIXIN  -->
						<view class="ad-item" v-if="stationIndex==2&&stationList.length>=3&&adData&&adData.is_show">
							<ad v-if="adData.type==1" :unit-id="adData.banner_id" :ad-intervals="30"></ad>
							<view v-if="adData.type==2" @click="goApp" class="diy-ad display-flex display-flex-justify-center">
								<image style="height: 130px;width: 100%;"  :src="adData.image" ></image>
							</view>
							<view v-if="adData.type==3" @click="goselfApp" class="diy-ad display-flex display-flex-justify-center">
								<image style="height: 130px;width: 100%;"  :src="adData.image" ></image>
							</view>
							<view v-if="adData.type==4">
								<ad v-if="adData.b_type==2" adpid="1128613343" unit-id="adunit-44a2d05a5ce645a4" :ad-intervals="30"></ad>
								<sx-banner  v-if="adData.b_type==1" :unitId="adData.banner_id"></sx-banner>
								
								<sx-cust  v-if="adData.b_type==3" :unitId="adData.cust_id"></sx-cust>
								
								<ad-interstitial v-if="adData.c_type==2"  ref="adinterstitial" @load="onload"   :adpid="1866657604" :loadnext="true" >             </ad-interstitial> 
								<sx-cp v-if="adData.c_type==1"  :unitId="adData.cp_id" ></sx-cp>
							</view>
						</view>
					    <!-- #endif -->
					</view>
					
					<view v-if="!stationList.length&&!nodata" class="">
						<view class="station-card" v-for="(item,index) in 5" :key="index">
							<view class="station-card-head station-card-head-border-bottom display-flex display-flex-column">
								<view class="display-flex display-flex-justify-space-between">
									<view class="display-flex">
										<wSkeleton  rowWidth="30px" title animate :loading="baseLoging">
										</wSkeleton>
										<wSkeleton  rowWidth="60px" title animate :loading="baseLoging">
										</wSkeleton>
										<wSkeleton  rowWidth="30px" title animate :loading="baseLoging">
										</wSkeleton>
									</view>
									<view class="">
										<wSkeleton  rowWidth="30px" title animate :loading="baseLoging">
										</wSkeleton>
									</view>
								</view>
								<view class="display-flex display-flex-justify-space-between">
									<view class=" display-flex display-flex-column display-flex-justify-flex-start">
										<wSkeleton  rowWidth="60px" title animate :loading="baseLoging">
										</wSkeleton>
										<wSkeleton  rowWidth="90px" title animate :loading="baseLoging">
										</wSkeleton>
										
									</view>
									<view class="  display-flex display-flex-column display-flex-justify-flex-end">
										<wSkeleton  rowWidth="90px" title animate :loading="baseLoging">
										</wSkeleton>
										<wSkeleton  rowWidth="60px" title animate :loading="baseLoging">
										</wSkeleton>
									</view>
								</view>
								<view class="display-flex display-flex-justify-space-between">
									<view class=" display-flex display-flex-column display-flex-justify-flex-start">
										<wSkeleton  rowWidth="60px" title animate :loading="baseLoging">
										</wSkeleton>
										<wSkeleton  rowWidth="90px" title animate :loading="baseLoging">
										</wSkeleton>
										
									</view>
									<view class="  display-flex display-flex-column display-flex-justify-flex-end">
										<wSkeleton  rowWidth="90px" title animate :loading="baseLoging">
										</wSkeleton>
										<wSkeleton  rowWidth="60px" title animate :loading="baseLoging">
										</wSkeleton>
									</view>
								</view>
							</view>
						</view>
					</view>
					
				</block>
				<!-- </scroll-view> -->
			</view>
			<!-- 我的收藏 -->
			<view class="collection-box" v-if="swiperIndex == 1">
				<!-- 收藏未为空提示 -->
				<view class="column" style="width:100%" v-if="!collectList.length">
					<image src="https://qiniu.gybsky.cn/other%2F111b4a622e52d7bcc7cb7f0df3b76e9a.png"
						style="width:180rpx;height:180rpx;margin-top:160rpx;margin-left:auto;margin-right:auto;margin-bottom: 40rpx;">
					</image>
					<text style="margin-top:-60rpx;margin-left:auto;margin-right:auto;">还没有收藏的公交线路</text>
				</view>

				<!-- 收藏列表 -->
				<view  v-if="collectList.length !== 0">
				
					<block  v-for="(collectListItem,collectListIndex) in collectList" :key="collectListIndex">
						<view class="collection-list" @click="goLineDetail(collectListItem)">
							<view class="collection-list-item">
								<view class="line-name">
									<view class="leftnew">
										<wSkeleton  rowWidth="200px" title animate :loading="collectLoading">
											<view class="qs-line-name">
												{{collectListItem.lineName}}
											</view>
										</wSkeleton>
										<wSkeleton  rowWidth="170px" title animate :loading="collectLoading">
											<view class="fonthc">
											   <text class="marginright5">候车站</text>
											   <text>{{collectListItem.stationName}}</text>
											</view>
										</wSkeleton>
										<wSkeleton  rowWidth="150px" title animate :loading="collectLoading">
											<view class="line-direction">开往{{collectListItem.startStopName}}</view>
										</wSkeleton>
										
									</view>
									<view class="rightnew">
										<view v-if="collectListItem.status==0" class="display-flex display-flex-column display-flex-align-end">
											<wSkeleton rowWidth="50px" title animate :loading="collectLoading">
											<view v-if="collectListItem.oneBus" class="">
												<view v-if="collectListItem.oneBus.text!='已到站'" class="display-flex font18 fontw">
													<view  :class="collectListItem.oneBus.text=='即将到站'?'txorcolor':'bluecolor'">
														{{collectListItem.oneBus.text}}
														<text style="margin: 0 3px;">·</text>
													</view>
													<view :class="collectListItem.oneBus.text=='即将到站'?'txorcolor':'bluecolor'" class="display-flex display-flex-align-start">
														<view  class="tx-trave">{{collectListItem.oneBus.travelTime.value}}</view>
														<view >{{collectListItem.oneBus.travelTime.unit}}</view>
														<image  style="width: 8px;height: 8px;margin-left: 2px;" :src="collectListItem.oneBus.text=='即将到站'?'../../static/images/bus/ico-wifi-or.gif':'../../static/images/bus/ico-wifi-blue.gif'"></image>
														
													</view>
												</view>
												<view v-if="collectListItem.oneBus.text=='已到站'" class="txorcolor fontw font18">
													已到站
												</view>
									
											</view>
											</wSkeleton>
											<wSkeleton  rowWidth="80px" title animate :loading="collectLoading">
											<view v-if="collectListItem.twoBus" class="next-one display-flex display-flex-align-center">
												<view class="marginright5">
													下辆
												</view>
												<view class="marginright5">
													{{collectListItem.twoBus.text}}
												</view>
												<view  v-if="parseInt(collectListItem.twoBus.travelTime.value)>0" class="">
													{{collectListItem.twoBus.travelTime.value}}{{collectListItem.twoBus.travelTime.unit}}
												</view>
											</view>
										    </wSkeleton> 
										</view>
										<view v-else class="bluecolor fontw font18">
											<wSkeleton rowWidth="80px" title animate :loading="collectLoading">
											{{collectListItem.notice?collectListItem.notice:""}}
											</wSkeleton> 
										</view>
									
									</view>
								</view>
								
							</view>
						</view>
						
					</block>
				</view>
				<!-- </scroll-view> -->
			</view>

		</view>
		<!-- 今日看点 -->
		<!-- <view class="information-box">
			<view class="sub-title-box">
				<view class="line-left"></view>
				<view class="sub-title">今日看点</view>
			</view>
			<view class="information-content-box">
				<image class="information-img" @click="lookInformation"
					:src="$Common.imgUrl('/bus/bus_index/bus_bg.jpg')" mode="widthFix"></image>
			</view>
		</view> -->
		<!-- <adhd :sharePacket="sharePacket"></adhd> -->
		<!-- 遮罩 -->
		<!-- <view class="mask" v-if="isShowMask"></view> -->
		<z-navigation ref="nav"></z-navigation>
		
		<goBus></goBus>
	   <!-- #ifdef MP-WEIXIN -->
	   <adPopup :window="adPopup.isShow" :image="adPopup.image" @clickImage="navToPath(adPopup)"  @onColse="adPopup.isShow=false"></adPopup>
	   	
	   <!-- #endif -->
	   <!-- #ifdef MP-ALIPAY -->
	   <adPopup :window="adPopup.aliShow" :image="adPopup.image" @clickImage="navToPath(adPopup)"  @onColse="adPopup.aliShow=false"></adPopup>
	   	
	   <!-- #endif -->
	</view>
</template>

<script>
	 import goBus from '@/components/go_bus/index.vue'
	 import b_util from "@/common/js/busutil.js"
	 import { wgs84togcj02 } from "@/common/js/mapUtil.js"
	 import Cache from '../../utils/cache';
	 import { CITY_INFO, LOCATION_CITY_INFO, USER_LOCATION } from '../../config/cache.js'
	import {
		getNavigation
	} from '@/api/public.js';
	import { getNearStation , getCollectRealBusLine, getRealBusApi} from '@/api/real_bus.js'
	
	import {
		getRealIndex, initLngLat, getRealBusPop
	} from '@/api/api.js';
	// import adhd from '@/components/adhd/index';
	import adPopup from '@/components/adPopup/index';
	import {toLogin} from '@/libs/login.js';
	import { mapGetters } from "vuex";
	import { wSkeleton} from "@/components/wSkeleton/skeleton.vue"
	import  vtabs  from "@/components/vTabs/index.vue"
	import  localBar  from "@/components/local-bar/index.vue"
	export default {
		components: {
			wSkeleton, vtabs, localBar,adPopup,goBus
		},
		computed: mapGetters(['isLogin', 'chatUrl', 'userInfo', 'uid']),
		data() {
			return {
				adPopup: {
				  image: "",
				  appid: null,
				  name: "",
				  type: null,
				  url: "",
				  isShow: 0				
				},
				collectLoading: true,
				baseLoging: true,
				realbusLoading: true,
				sharePacket: {
					isState: true, //默认不显示
					touchstart:false
				}, 
				adData: null,
				newData: {},
				city: "",
				
				firstEntry: true, //首次获取
				tabbar:[ '附近站点','我的收藏'],
				swiperIndex: 0,
				contentHeight: '',
				mainHeight: '',
				nodata: false, //没有数据提示

				stationList: [], //站点列表

				collectList: [], //收藏列表

				openType: true, //最近站点的查看更多

				setInterTime: null ,//定时器对象
				isShowMask:false,//是否是接口请求中
				isInitLoc: false,
				showLocalAuth: false,
				isScopeLoc: false,
			}
		},
		onPullDownRefresh(){
			this.busRefresh()
		},
		onLoad() {
			// #ifdef MP-ALIPAY
			my.hideBackHome();
			// #endif
			// 隐藏原生的tabbar
			uni.hideTabBar();
			//  高度自适应
			let that = this;
			uni.getSystemInfo({
				success: function(res) {
					// console.log(res);
					let calc = res.windowHeight;
					// that.mainHeight = calc;
					// that.contentHeight = calc - 120;
				}
			});
			
			
			// 定位
			this.initLngLat();
			
			// this.getNearStation()
		
			this.getRealIndex()
			
			this.getRealBusPop()
			if (that.isLogin) {
				// this.getRealIndex()
				// this.initCollect();
			} else {
				// toLogin();
			}
			// 重新获取城市
			if (this.swiperIndex == 0) {
				// 刷新实时数据
				// clearInterval(this.setInterTime);
				// this.setInterTime = setInterval(() => {
				// 	that.getNearStationBusTime();
				// }, 15000)
			} else {
				// 收藏
				// this.initCollect();
			}
			
		},
		
		onShow() {
			this.$nextTick( () =>{
				this.$refs.nav.initnav()
			})
			var that = this
			if(!Cache.has(CITY_INFO) && that.isInitLoc == true){
				// #ifdef MP
				uni.getSetting({
				    success: (res) => {
				    let authSetting = res.authSetting
				    if (authSetting['scope.userLocation']) {
				      // 已授权
					  that.initLngLat()
				    } else {
				      uni.showModal({
				        title: '您未开启地理位置授权',
				        content: '是否前往开启位置权限',
				        success: res => {
				          if (res.confirm) {
				            uni.openSetting()
				          } else {
							  // uni.navigateTo({
							  // 	url:"/pages/city_select/index"
							  // })
							    Cache.set(CITY_INFO,{id: 2,name: "遵义市",lat: "27.70693",lng: "106.935849"})
						  }
				        }
				      })
				    }
				  }
				})
				//#endif
				// #ifdef APP-PLUS || H5
				uni.navigateTo({
					url:"/pages/city_select/index"
				})
				//#endif
			} 
			if(Cache.has(CITY_INFO)){
				if(Cache.has(LOCATION_CITY_INFO)){
					if(JSON.parse(Cache.get(CITY_INFO)).id != JSON.parse(Cache.get(LOCATION_CITY_INFO)).id){
						that.tabbar[0] = "市中心"
					}
					
				} else {
					that.tabbar[0] = "市中心"
				}
				
				var cityInfo = JSON.parse(Cache.get(CITY_INFO))
				that.city = cityInfo.name
				
				that.getNearStation()
				
			}
			// #ifdef MP
			uni.getSetting({
			    success: (res) => {
			    let authSetting = res.authSetting
			    if (authSetting['scope.userLocation']) {
			      // 已授权
				  that.showLocalAuth = false
			    } else {
			     that.showLocalAuth = true
			    }
			  }
			})
			//#endif
			
			
		},
		
		destroyed() {
			clearInterval(this.setInterTime);
		},
		filters: {
			formatDisplay(val) {
				if (val.isRun == null) {
					return '正在查询';
				}
				if (!val.isRun) {
					return '不在运营时间';
				}
				if (val.targetStationCount == null) {
					return '等待首站发车';
				}
				if (val.targetStationCount == 0) {
					return '已到站';
				}
				if (val.targetStationDistance < 400 && val.targetStationCount > 0) {
					return '即将到站';
				}

				let time = val.targetStationDistance / val.speed;

				return `${(time/60).toFixed(0)}分钟 • ${val.targetStationCount}站`;
			}
		},
		methods: {
			navToPath(item){
				if(item['type'] == 1){
					 uni.navigateTo({
						url:item.url
					 })
				} else if(item['type']== 2){
					
			
					// #ifdef MP-WEIXIN
					 uni.navigateToMiniProgram({
					 	appId: item.appid, 
					 	path: item.url,
					 	extraData: {
					 	},
					 	success(res) {
					     // 打开成功
					 	}
					 })
					 // #endif
					 // #ifdef APP-PLUS
					   //需调用plus.share.getServices获取微信分享服务对象    
					  plus.share.getServices((s) => {    
						  let sweixin = {};    
						  for (let i = 0; i < s.length; i++) {    
							  let share = s[i];    
							  if (share.id === 'weixin') {    
								  sweixin = share    
							  }    
						  }    
						  //小程序参数，必填    
						  let WeixinMiniProgramOptions = {    
							  id: item.g_id,    
							  path: item.url,//可指定打开的页面    
						  }    
						  sweixin ? sweixin.launchMiniProgram(WeixinMiniProgramOptions) : plus.nativeUI.alert(    
							  '当前环境不支持微信操作!');    
					  }, function(e) {    
						  console.log("获取分享服务列表失败：" + e.message);    
					  });  
					  // #endif
					// #ifdef MP-ALIPAY
					
				
					 uni.navigateToMiniProgram({
						appId: item.appid, 
						path:  item.url,
						extraData: {
						},
						success(res) {
						   // 打开成功
						}
					 })
					 // #endif
			
				}else if(item['type']== 4){
					 uni.switchTab({
						url:item.url
					 })
				} else if(item['type']==5){
					console.log("跳转支付宝页面")
					//跳转支付宝页面
					 // #ifdef MP-ALIPAY
					 my.ap.openURL({
					   url:  item.aliUrl, // 请将 url 替换为有效的页面地址
					   success: (res) => {
					     console.log('openURL success', res)
					   },
					   fail: (err) => {
					     console.log('openURL success', err)
					   }
					 });
					  // #endif
					  // #ifdef MP-WEIXIN
					  console.log(2333,item)
					  uni.navigateTo({
					  		url:'/pages/web/web?url='+item.url2
					  })
					   // #endif
					   return
				} else{
					 uni.navigateTo({
						url:'/pages/web/web?url='+item.url
					 })
				}
			},
			busRefresh(){
				let that = this;
				if (this.swiperIndex == 0 && this.isShowMask == false) {
					this.isShowMask = true;
					// 定位
					this.initLngLat();
					
				} else {
					// 更新我的收藏
					this.initCollect();
				}
				this.isShowMask = false;
				setTimeout(function() {
					uni.stopPullDownRefresh();
				}, 500)
			},
			// 修改城市地址
			changeAddress() {
				// this.isShowMask = true;
				// return;
				var source = 'bus';
				uni.navigateTo({
					url: `/pages/city_select/index?source=${source}`
				})
			},
			// 跳转搜索页
			goSearch() {
				uni.navigateTo({
					url: '/pages/search/index'
				});
			},
			// 快捷功能按钮
			menuClick(item) {
				this.$Common.msg('功能开发中...');
				// console.log(JSON.stringify(item));
			},
			initLngLat(){
				var that = this
				// #ifdef MP
				uni.getSetting({
				    success: (res) => {
				    let authSetting = res.authSetting
				    if (authSetting['scope.userLocation']) {
				      // 已授权
					 that.isScopeLoc = true
				    } else {
				     that.isScopeLoc = false
				    }
				  }
				})
				//#endif
				uni.getLocation({
					type: 'gcj02',
					altitude: true,
					success: function(res) {
						
						
						initLngLat({lng: res.longitude,lat: res.latitude,}).then(res2 => {
							
							res2 = res2.data
							if(res2 && res2.id){
								Cache.set(CITY_INFO,{id: res2.id,name: res2.cityName,lng: res.longitude,lat: res.latitude,})
								Cache.set(LOCATION_CITY_INFO,{id: res2.id,name: res2.cityName,lng: res.longitude,lat: res.latitude})
							    that.city = res2.cityName
							} else{
								that.nodata = true
							}
							
							Cache.set(USER_LOCATION,{lng: res.longitude,lat: res.latitude,})
							
							
							that.isInitLoc = true
							
							if(!that.isScopeLoc){
								that.getNearStation()
							}
							that.isScopeLoc = true
							that.showLocalAuth = false
						
							
						}).catch(err => {
							console.log('err',err)
							that.isInitLoc = true
							if(!Cache.has(CITY_INFO)){
								// uni.navigateTo({
								// 	url:"/pages/city_select/index"
								// })
								Cache.set(CITY_INFO,{id: 2,name: "遵义市",lat: "27.70693",lng: "106.935849"})
								
							}
							
					
						})
						
					},
					complete: function(res) {
					},
					fail: function(err){
						console.log('err',err)
						that.isInitLoc = true
						if(!Cache.has(CITY_INFO)){
							// uni.navigateTo({
							// 	url:"/pages/city_select/index"
							// })
							Cache.set(CITY_INFO,{id: 2,name: "遵义市",lat: "27.70693",lng: "106.935849"})
							
						}
						
					}
				
				});
				
				
			},
			
			getNearStation() { //获取附近站点
			    var that = this	;
				var lat = '', lng = '';
				// var userLocation = JSON.parse(Cache.get(USER_LOCATION))
				that.nodata = false;
				var city = JSON.parse(Cache.get(CITY_INFO))
				lat = city.lat
				lng = city.lng
				getNearStation({
					longitude: lng,
					latitude: lat
				}).then(res => {
					
					if (res.data.length == 0) { //附近没有站点
					    this.stationList = [];
						that.nodata = true;
						that.realbusLoading = false
						that.baseLoging = false
						return false;
					}
					this.stationList = res.data;
					
					this.stationList.forEach((val, index) => {
						that.$set(val, 'isOpen', false);
					})
					
					that.getNearStationBusTime(0);
				})
				
				
				
			},
			//展开收起
			changeStationState(stationIndex) {
				// console.log(JSON.stringify(stationItem));
				if(this.isShowMask == false){
					if(!this.stationList[stationIndex].isOpen ){
						this.getNearStationBusTime(stationIndex);
					}
			        this.stationList[stationIndex].isOpen = !this.stationList[stationIndex].isOpen
				
				}
			},
			// 点击查看更多
			setOpenType() {
				this.openType = !this.openType;
			},
			// 排序函数
			 objArraySort(objArr, key) {
				let result = objArr.slice(0);
				return result.sort((a, b) => a[key] - b[key]);
			},
			
			getRealBusAll(stationIndex){
				var that = this
				var nearbySegment = this.stationList[stationIndex].nearbySegment;
				
				that.realbusLoading = true
				var city = Cache.has(CITY_INFO)? JSON.parse(Cache.get(CITY_INFO)) : ""
				nearbySegment.forEach((item, index) => {
					
					getRealBusApi({
						lineId: item.lineId,
						targetOrder: item.stationOrder,
						cityId: city.id
					}).then(res => {
						var data = res.data
						
					    var stopOrder =  data.targetOrder;
					    var lineData = b_util.parseRealtimeBusLineStation(data,stopOrder)
						// console.log("lineData",lineData)
						that.$set(that.stationList[stationIndex].nearbySegment[index],'status',lineData.status)
						that.$set(that.stationList[stationIndex].nearbySegment[index],'notice',lineData.notice)
						
						if(lineData.buses.length>=0){
							
							var busList = []
							
							lineData.buses.forEach((el, index) => {
								var lag = wgs84togcj02(el.lng, el.lat)
								lineData.buses[index].lng = lag[0]
								lineData.buses[index].lat = lag[1]
								if((stopOrder) - el.order >=0){
									busList.push({
									 	key: (stopOrder) - el.order,
										value: el
									})
								}
						
							})
							
							busList = that.objArraySort(busList, "key")
							
							if(busList.length >=2){
								 if(busList[0].value.distanceToWaitStn <= busList[1].value.distanceToWaitStn){
									 that.$set(that.stationList[stationIndex].nearbySegment[index],'oneBus', busList[0].value)
									 that.$set(that.stationList[stationIndex].nearbySegment[index],'twoBus', busList[1].value)
								 } else {
									 that.$set(that.stationList[stationIndex].nearbySegment[index],'oneBus', busList[1].value)
									 that.$set(that.stationList[stationIndex].nearbySegment[index],'twoBus', busList[0].value)
								 }
															
							} else if(busList.length == 1)  {
								that.$set(that.stationList[stationIndex].nearbySegment[index],'oneBus', busList[0].value)
							}
							
							// busList.forEach((el, indexb) => {
								
							// 	if(indexb == 0){
							// 		that.$set(that.stationList[stationIndex].nearbySegment[index],'oneBus',busList[indexb].value)
							// 	} else if(indexb == 1){
							// 		that.$set(that.stationList[stationIndex].nearbySegment[index],'twoBus',busList[indexb].value)
									
							// 	}
							// })
						}
						
						that.stationList[stationIndex].isOpen = true;
						that.realbusLoading = false
						that.baseLoging = false		
					}).catch( err => {
						that.realbusLoading = false
					})
					// uni.request({
					// 	url: "http://open.chelaile.net.cn/bus/line!tpLineDetail.action?s=api&v=0.1&sign=EpDYBeAlUz2hfg5WGx&cityId=989&lineId="+item.lineId+'&targetOrder='+item.stationOrder,
					// 	method: 'GET',
					// 	timeout: 20000,
					// 	success: (res) => {
					// 		var data = res.data
					// 		data = JSON.parse(data.replace("**YGKJ","").replace("YGKJ##",""))
							
							
					// 		var stopOrder =  data.jsonr.data.targetOrder;
					// 		var lineData = b_util.parseRealtimeBusLineStation(data.jsonr.data,stopOrder)
					// 		console.log('lineData',lineData)
					// 		that.$set(that.stationList[stationIndex].nearbySegment[index],'status',lineData.status)
					// 		that.$set(that.stationList[stationIndex].nearbySegment[index],'notice',lineData.notice)
							
							
					// 		if(lineData.buses.length>=0){
								
					// 			var busList = []
								
					// 			lineData.buses.forEach((el, index) => {
					// 				var lag = wgs84togcj02(el.lng, el.lat)
					// 				lineData.buses[index].lng = lag[0]
					// 				lineData.buses[index].lat = lag[1]
					// 				if((stopOrder) - el.order >=0){
					// 					busList.push({
					// 					 	key: (stopOrder) - el.order,
					// 						value: el
					// 					})
					// 				}
							
					// 			})
								
					// 			busList = that.objArraySort(busList, "key")
					// 			busList.forEach((el, indexb) => {
									
					// 				if(indexb == 0){
					// 					that.$set(that.stationList[stationIndex].nearbySegment[index],'oneBus',busList[indexb].value)
					// 				} else if(indexb == 1){
					// 					that.$set(that.stationList[stationIndex].nearbySegment[index],'twoBus',busList[indexb].value)
										
					// 				}
					// 			})
					// 		}
							
					// 		that.stationList[stationIndex].isOpen = true;
					// 		that.realbusLoading = false
					// 		that.baseLoging = false			
					// 	},
					// 	fail: (msg) => {
					// 		that.realbusLoading = false
					// 	}
					// })
									
				})
				
	
			
			},
			
			getNearStationBusTime(stationIndex) { //到站时间，index站点的数组索引
				let that = this;
				var arr = [];
				/**没有数据直接返回**/
				// console.log('that.nodata',that.nodata)
				if (that.nodata == true) {
					return false;
				}
				
				
				that.getRealBusAll(stationIndex)
				
				
			},
			
			goLineDetail(lineItem){
	
				clearInterval(this.setInterTime);
				uni.navigateTo({
					url: `/pages/real_bus/line_detail?stationId=${lineItem.stationId}&lineId=${lineItem.lineId}`,
					complete(res) {
					}
				})
			},
			
			
			

			
			// 点击标题切换当前页时改变样式
			swichNav(e) {
				let cur = e;
				if (this.swiperIndex == cur) {
					return false;
				} else {
					this.swiperIndex = cur
					//this.loadData(this.currentTab);
					if (this.swiperIndex == 1) {
						this.initCollect(); //收藏线路
					}
				}

			},
			// 滚动切换标签样式
			changeTab: function(e) {
				let that = this;
				this.swiperIndex = e.detail.current;
				if (this.swiperIndex == 1) {
					this.initCollect(); //收藏线路
				}
			},
			getCollectRealTime(collectList){
				var that = this
				var city = Cache.has(CITY_INFO)? JSON.parse(Cache.get(CITY_INFO)) : ""
				collectList.forEach((item, index) => {
					
					getRealBusApi({
						lineId: item.lineId,
						targetOrder: item.stationOrder,
						cityId: city.id
					}).then(res => {
						var data = res.data
						var stopOrder =  data.targetOrder;
						var lineData = b_util.parseRealtimeBusLineStation(data,stopOrder)
						that.$set(that.collectList[index],'status',lineData.status)
						that.$set(that.collectList[index],'notice',lineData.notice)
						
						
						if(lineData.buses.length>=0){
							
							var busList = []
							
							lineData.buses.forEach((el, index) => {
								var lag = wgs84togcj02(el.lng, el.lat)
								lineData.buses[index].lng = lag[0]
								lineData.buses[index].lat = lag[1]
								if((stopOrder) - el.order >=0){
									busList.push({
									 	key: (stopOrder) - el.order,
										value: el
									})
								}
						
							})
							
							busList = that.objArraySort(busList, "key")
							
							if(busList.length >=2){
								 if(busList[0].value.distanceToWaitStn <= busList[1].value.distanceToWaitStn){
									 that.$set(that.collectList[index],'oneBus', busList[0].value)
									 that.$set(that.collectList[index],'twoBus', busList[1].value)
								 } else {
									 that.$set(that.collectList[index],'oneBus', busList[1].value)
									 that.$set(that.collectList[index],'twoBus', busList[0].value)
								 }
															
							} else {
								that.$set(that.collectList[index],'oneBus', busList[0].value)
							}
							
							
						}
						
						setTimeout(function(){
							that.collectLoading = false
						},500)	
					}).catch(err => {
						setTimeout(function(){
							that.collectLoading = false
						},500)		
					})
					// uni.request({
					// 	url: "http://open.chelaile.net.cn/bus/line!tpLineDetail.action?s=api&v=0.1&sign=EpDYBeAlUz2hfg5WGx&cityId=989&lineId="+item.lineId+'&targetOrder='+item.stationOrder,
					// 	method: 'GET',
					// 	timeout: 20000,
					// 	success: (res) => {
					// 		var data = res.data
					// 		data = JSON.parse(data.replace("**YGKJ","").replace("YGKJ##",""))
							
							
					// 		var stopOrder =  data.jsonr.data.targetOrder;
					// 		var lineData = b_util.parseRealtimeBusLineStation(data.jsonr.data,stopOrder)
					// 		that.$set(that.collectList[index],'status',lineData.status)
					// 		that.$set(that.collectList[index],'notice',lineData.notice)
							
							
					// 		if(lineData.buses.length>=0){
								
					// 			var busList = []
								
					// 			lineData.buses.forEach((el, index) => {
					// 				var lag = wgs84togcj02(el.lng, el.lat)
					// 				lineData.buses[index].lng = lag[0]
					// 				lineData.buses[index].lat = lag[1]
					// 				if((stopOrder) - el.order >=0){
					// 					busList.push({
					// 					 	key: (stopOrder) - el.order,
					// 						value: el
					// 					})
					// 				}
							
					// 			})
								
					// 			busList = that.objArraySort(busList, "key")
					// 			busList.forEach((el, indexb) => {
									
					// 				if(indexb == 0){
					// 					that.$set(that.collectList[index],'oneBus',busList[indexb].value)
					// 				} else if(indexb == 1){
					// 					that.$set(that.collectList[index],'twoBus',busList[indexb].value)
										
					// 				}
					// 			})
					// 		}
							
					// 		setTimeout(function(){
					// 			that.collectLoading = false
					// 		},500)				
					// 	},
					// 	fail: (msg) => {
					// 		setTimeout(function(){
					// 			that.collectLoading = false
					// 		},500)	
					// 	}
					// })
									
				})
			},
			
			//获取收藏线路
			initCollect(isShowLoading) {
				var that = this
				var city = Cache.has(CITY_INFO)? JSON.parse(Cache.get(CITY_INFO)) : ""
				getCollectRealBusLine({
					cityId: city.id
				}).then(res => {
					that.collectList = res.data;
					if(that.collectList.length){
						that.getCollectRealTime(that.collectList)
					} else{
						that.collectLoading = false
					}
					
				})
				
			},
			
			
			
			// 今日看点
			lookInformation() {

			},
			getRealIndex(){
				var that = this
				getRealIndex().then( res => {
					that.adData = res.data
				})
			}, 
			getRealBusPop(){
				var that = this
				getRealBusPop().then( res => {
					that.adPopup = res.data
				})
			},
			onload(e) {
					
			  setTimeout(res => {
				  this.$refs.adinterstitial.show()
			  },3500)
			},
			goselfApp(){
				uni.navigateTo({
					url: this.adData.path,
				})
			},
			goApp(item){
				// #ifdef MP-WEIXIN
				 uni.openEmbeddedMiniProgram({
				 	appId: this.adData.appid, 
				 	path: this.adData.url,
				 	extraData: {
				 	},
				 	success(res) {
				     // 打开成功
				 	}
				 })
				 // #endif
				 // #ifdef APP-PLUS
				   //需调用plus.share.getServices获取微信分享服务对象    
				  plus.share.getServices((s) => {    
					  let sweixin = {};    
					  for (let i = 0; i < s.length; i++) {    
						  let share = s[i];    
						  if (share.id === 'weixin') {    
							  sweixin = share    
						  }    
					  }    
					  //小程序参数，必填    
					  let WeixinMiniProgramOptions = {    
						  id: this.adData.g_id,    
						  path: this.adData.url,//可指定打开的页面    
					  }    
					  sweixin ? sweixin.launchMiniProgram(WeixinMiniProgramOptions) : plus.nativeUI.alert(    
						  '当前环境不支持微信操作!');    
				  }, function(e) {    
					  console.log("获取分享服务列表失败：" + e.message);    
				  });  
				  // #endif
				  // #ifdef MP-ALIPAY
				   uni.navigateToMiniProgram({
						appId: '2021003184687759', 
						path: '/pages/home/dashboard/index',
						extraData: {
						},
						success(res) {
						   // 打开成功
						}
				   })
				   // #endif
			},
			
		}
	}
</script>

<style lang="scss" scoped>
	.ad-item{
		background-color: #fff;
		border-radius: 16rpx;
		margin: 40rpx;
		box-shadow: 0rpx 6rpx 6rpx 0rpx rgba(154, 154, 154, 0.75);
	}
	// /*  */
	.bus-page {
		// #ifdef H5
		min-height: calc(100vh - var(--window-top) - 100rpx);
		// #endif
		// #ifdef APP-PLUS || MP
		min-height: calc(100vh - var(--window-top));
		// #endif
		position: relative;
	}

	// 顶部功能，搜索，快捷按钮
	.bus-index-top {
		background-color: #FEFBFB;
		box-shadow: 0rpx 6rpx 6rpx 0rpx rgba(186, 182, 182, 0.75);
		position: sticky;
		// #ifdef H5
		// top: 88rpx;
		// #endif
		// #ifdef APP-PLUS || MP
		top: 0rpx;
		// #endif
		z-index: 10;

		// /* 搜索 */
		.search-box {
			// height: 120rpx;
			display: flex;
			justify-content: flex-start;
			align-items: center;
			padding: $uni-spacing-col-base $uni-spacing-row-base;

			// 定位
			.location-box {
				display: flex;
				justify-content: flex-start;
				align-items: center;

				.location-address {
					max-width: 150rpx;
					overflow: hidden;
					// text-overflow:ellipsis;
					white-space: nowrap;
				}

				.icon-dsj {
					margin-left: 10rpx;
				}
			}

			// 搜索框
			.search-input-containt {
				flex: 1;
				display: flex;
				align-items: center;
				margin: 0rpx $uni-spacing-row-base;
				padding: 16rpx;
				border: 1px solid #DBE0E9;
				border-radius: 50rpx;
				background-color: #EEF0F4;

				.search-input-icon-search {
					width: 40rpx;
					height: 40rpx;
					margin: 0 8rpx;
				}

				.search-input-edit {
					color: #909399;
				}
			}
		}

		// 快捷按钮
		.menu-box {
			display: flex;
			justify-content: space-around;
			align-items: center;
			padding: $uni-spacing-col-base 100rpx;

			.menu-item {
				margin: 0rpx $uni-spacing-row-base;
				text-align: center;

				.menu-img {
					width: 80rpx;
					height: 80rpx;
				}
			}
		}
	}
	// 公交内容
	.bus-content-box{
		// padding-bottom: 360rpx;
		// 选项卡
		.tab-box {
			margin-top: 40rpx;
			// text-align: center;
			height: 46rpx;
			margin-left: 40rpx;
		
			.tab-list {
				display: inline-flex;
				flex-direction: row;
		
				.tab-item {
					margin-right: 40rpx;
					display: flex;
					flex-direction: column;
		
					.tab-text-content {
						display: flex;
						justify-content: flex-start;
						align-items: center;
		
						.tab-icon {
							width: 32rpx;
							height: 32rpx;
							margin: 0rpx;
							margin-right: 10rpx;
						}
		
						.tab-text {
							height: 32rpx;
							line-height: 32rpx;
							font-size: $uni-font-size-base;
						}
		
						.tab-action {
							font-weight: bold;
							color: #000;
							font-size: 30rpx;
						}
						.on-action{
							color: #a2a2a2;
							font-size: 15px;
						}
					}
		
					image {
						width: 32rpx;
						height: 6rpx;
						margin-left: 40%;
						margin-top: 12rpx;
					}
				}
			}
		}
		
		// 站点列表
		.staion-box {
			// min-height: 420rpx;
			margin-top: 20px;
			padding-bottom: 40rpx;
			
		}
		
		.station-card {
			background-color: #fff;
			border-radius: 16rpx;
			margin: 20rpx 30rpx;
			padding: 0 30rpx 0 40rpx;
			box-shadow: 0rpx 1rpx 1rpx 0rpx rgba(154, 154, 154, 0.1);
			
			.station-card-head {
				display: flex;
				justify-content: space-between;
				padding: 30rpx 0;
		
				.left {
					display: flex;
					align-items: center;
		
					.station-name {
						font-weight: bold;
						// font-size: 30rpx;
						color: rgba(0, 0, 0, 0.87);
					}
		
					image {
						height: 40rpx;
						width: 36rpx;
						margin-right: 12rpx;
					}
		
					.home-font-sub {
						margin-top: 8rpx;
						margin-left: 10rpx;
					}
				}
		
				.right {
					display: flex;
					align-items: center;
		
					image {
						height: 48rpx;
						width: 48rpx;
					}
				}
			}
		
			.station-card-head-border-bottom {
				border-bottom: 1px solid rgba(224, 224, 224, 0.4);
			}
		
			// 列表
			.station-card-list {
				// margin-top: 50rpx;
		
				.station-card-list-item {
					border-bottom: 1px solid rgba(224, 224, 224, 0.4);
					padding: 15px 0 15px 0;
		
					.line-name {
						display: flex;
						justify-content: space-between;
		
						.left {
							font-weight: bold;
							color: rgba(0, 0, 0, 0.87);
						}
		
						.right {
							font-size: 32rpx;
							// color: #8f8f8f; //另一种字体颜色
							color: #007AFF;
							font-weight: bold;
		
							image {
								margin-right: 10rpx;
								width: 12rpx;
								height: 24rpx;
							}
						}
					}
		
					.line-direction {
						color: rgba(0, 0, 0, 0.38);
						margin-top: 12rpx;
						font-size: 28rpx;
		
						text {
							margin-left: 14rpx;
						}
					}
		
				}
		
		
			}
		
			.see-all {
				text-align: center;
				padding: 20rpx;
				// border-top: 1px solid rgba(224, 224, 224, 0.4);
			}
		
			// tag
			.station-card-tag-list {
				padding-bottom: 30rpx;
		
				.tag-item {
					display: inline-block;
					background-color: #e9f6ff;
					color: #007AFF;
					border-radius: 8rpx;
					margin: 8rpx;
					padding: 4rpx 10rpx;
					border: 0.5px solid rgba(0, 0, 0, 0.1);
				}
		
				.more-img {
					height: 4rpx;
					width: 22rpx;
					margin-left: 10rpx;
				}
			}
		
		}
		
		// 收藏列表
		.collection-box {
			min-height: 460rpx;
		}
		
		.collection-list {
			.collection-list-item {
				border-radius: 16rpx;
				box-shadow: 0rpx 4rpx 3rpx rgba(0, 0, 0, 0.1);
				padding: 40rpx;
				margin: 40rpx;
				background-color: #FFFFFF;
		
				.line-name {
					display: flex;
					justify-content: space-between;
		
					.left {
						font-weight: bold;
						color: rgba(0, 0, 0, 0.87);
					}
		
					.right {
						font-size: 32rpx;
						color: #007AFF;
						// color: #8f8f8f; //另一种字体颜色
						font-weight: bold;
		
						image {
							margin-right: 10rpx;
							width: 12rpx;
							height: 24rpx;
						}
					}
				}
		
				.line-direction {
					color: #9da1a9;
					margin-top: 12rpx;
					font-size: 28rpx;
		
					text {
						margin-left: 14rpx;
					}
				}
		
			}
		
		}
	}
	
	// 今日看点
	.information-box {
		position: absolute;
		bottom: 0rpx;

		.sub-title-box {
			height: 60rpx;
			line-height: 60rpx;
			padding: 0rpx $uni-spacing-row-base;
			display: flex;
			align-items: center;

			.line-left {
				width: 6rpx;
				height: 32rpx;
				background-color: #FF0000;
				margin-right: 10rpx;
			}

			.sub-title {
				font-weight: bold;
				color: #000406;
			}
		}

		.information-content-box {
			.information-img {
				width: 750rpx;
				height: 300rpx;
			}
		}
	}
	// 遮罩
	.mask{
		z-index: 99;
	}
	.triangle-border-down {
	    border: 8rpx solid transparent;
	    border-top-color: #000;
	    height: 0;
	    width: 0;
	}
	
	
	.navbar  {
		height: 120rpx;
		line-height: 120rpx;
		font-size: 30rpx;
		color: #050505;
		background-color: #fff;
		position: sticky;
		top: 0;
		z-index: 100;
	}
	
	.next-one{
		margin-top: 10px;
		font-size: 13px;
		color: #9da1a9;
	}
	
	.qs-line-name{
		color: #000000;
		font-size: 18px;
		font-weight: 600;
	}
	.marginright5{
		margin-right: 5px;
	}
	
	.txorcolor{
		color: #ff5c32;
	}
	
	.fontw{
		font-weight: 600;
	}
	.font18{
		font-size: 18px;
	}
	.bluecolor{
		color: #007AFF;
	}
	.fonthc{
		font-size: 13px;
		color: #595959;
		margin-top: 3px;
	}
	.page_hd {
	    // background-color: #fff;
		background: linear-gradient(to bottom, #007AFF, #2e89ed, #5d9ee5, #7bb3ef, #bcd7f5, #f5f5f5);
		
	}
	
	::-webkit-scrollbar {
	    width: 0;
	    height: 0;
	    color: transparent;
	}
	
	.rtbus-search-bar__box {
	    position: relative;
	    padding-left: 32rpx;
	    padding-right: 40px;
	    width: 100%;
	    box-sizing: border-box;
	    z-index: 1;
	}
	
	.rtbus-search-bar__input {
	    position: relative;
	    height: 96rpx;
	    margin-left: 20rpx;
	    margin-right: 56rpx;
	    color: rgba(128,128,128,1);
	    opacity: 0.6;
		background-color: #f6f6f6;
	}
	
	.rtbus-icon-clear {
	    position: absolute;
	    top: 0;
	    right: 0;
	    padding: 28rpx 32rpx;
	    font-size: 0;
	}
	
	.rtbus-searchbar-frame {
	    position: relative;
	    padding-top: 20rpx;
	    padding-left: 28rpx;
	    padding-right: 28rpx;
	    padding-bottom: 20rpx;
	    height: 66 rpx;
	    line-height: 66 rpx;
	    border-bottom: 1rpx solid #f2f2f2;
	    box-shadow: 0 6px 6px -6px rgba(0,0,0,0.06);
	    display: flex;
	}
	
	.rtbus-searchbar-button {
	    position: relative;
	    width: 100%;
	    height: 92 rpx;
	    line-height: 92 rpx;
	    border-radius: 14rpx;
	    border-color: #f6f6f6;
	    border-width: 0rpx;
	    background: #f6f6f6;
	    z-index: 1;
	    display: flex;
	    justify-content: space-between;
	    padding-left: 32rpx;
	}
	
	.rtbus-searchbar-button-title {
	    margin-top: 18rpx;
	    line-height: 56rpx;
	    height: 56rpx;
	    border-right: solid 1rpx rgba(27,45,118,0.12);
	    font-size: 32rpx;
	    color: #333333;
	    display: flex;
	}
	
	.rtbus-searchbar-button-name {
	    max-width: 130rpx;
	    overflow: hidden;
	    text-overflow: ellipsis;
	    white-space: nowrap;
	}
	
	.rtbus-searchbar-button-arrow {
	      height: 50rpx;
	      width: 50rpx;
	      /* margin-left: 20rpx; */
	      /* margin-right: 26rpx; */
	      // margin-top: 8rpx;
	}
	
	.rtbus-search-bar__input {
	    position: relative;
	    height: 92 rpx;
	    font-size: 32 rpx;
	    flex: 1;
		display: flex;
		align-items: center;
	}
	
	.rtbus-searchbar-label {
	    position: relative;
	    z-index: 2;
	    padding-left: 32rpx;
	    text-align: left;
	    color: #888888;
	    line-height: 92rpx;
	    font-size: 32rpx;
	}
	
	.input-placeholder {
	    color: #888888;
	}
</style>
